package com.atguigu.gulimall.member.config;

import com.atguigu.gulimall.member.interceptor.LoginUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author 小坏
 * @Date 2021/2/24 14:28
 * @Version 1.0
 * @program: 父工程 gulimall 万物起源之地
 * 会员服务拦截
 */

@Configuration
public class MemberWebConfing implements WebMvcConfigurer {

    @Autowired
    LoginUserInterceptor loginUserInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor (loginUserInterceptor).addPathPatterns ("/**");
    }
}
